package com.ysw.dao;

import com.ysw.entity.Shop;
import com.ysw.entity.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface ShopMapper extends Mapper<Shop> {

    @Select("SELECT * FROM m_shop u WHERE u.type LIKE CONCAT('%', #{type}, '%')")
    List<Shop> findByNameContaining(@Param("type") String type);

    @Update("ALTER TABLE m_shop AUTO_INCREMENT = 1")
    void resetAutoIncrement() throws Exception;

    @Select("SELECT count(*) FROM m_shop")
    int count();
}
